/* eslint-disable */
const { execSync } = require('child_process')
const manifest = require('./src/manifest.json')

// 微信开发者工具的命令行工具路径
const wechatDevToolCliPath =
  '/Applications/wechatwebdevtools.app/Contents/Resources/app.nw/bin/cli'

// 微信小程序的AppID
const appid = 'your-appid'

// 微信小程序项目的本地路径
const projectPath = '/path/to/your/project'

// 执行上传代码的命令
const uploadCommand = `${wechatDevToolCliPath} -u ${appid} --upload-desc '代码上传' -p ${projectPath}`

try {
  // 执行上传代码的命令
  execSync(uploadCommand)
  console.log('代码上传成功')
} catch (error) {
  console.error('代码上传失败', error)
}
